import request from '@/utils/request'

// 组题列表接口
export const getRandomsListApi = (params) => request({
    url: '/questions/randoms',
    method: 'get',
    params
})

// 权限列表接口
export const getPermissionListApi = params => request({
    url: '/permissions',
    params
})

// 删除
export const delPermissionApi = id => request({
    url: '/permissions/' + id,
    method: 'DELETE'
})

// 获取权限数据
export const getMenuListApi = () => request({
    url: '/menus'
})

// 权限添加
export const addUserPermissionApi = data => request({
    url: '/permissions',
    method: 'POST',
    data
})

// 获取用户权限详情
export const getUserPermissionInfoApi = id => request({
    url: '/permissions/' + id
})

// 修改用户权限
export const editUserPermissionApi = data => request({
    url: '/permissions/' + data.id,
    method: 'PUT',
    data
})